package ACWing.DataStructure.哈希表;
//80. 模拟散列表

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author :chenjie
 * @date :Created 2022/12/29 22:06
 */
public class SimulatedHashTable {
    static int[]e=new int[100003];
    static int[]ne=new int[100003];
    static int[]h=new int[100003];
    static int idx=0;

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        Arrays.fill(h,-1);
        int n=sc.nextInt();
        sc.nextLine();
        while (n-->0){
            String s=sc.next();
            int x=sc.nextInt();
            if("I".equals(s)){
                insert(x);
            }else {
                if (find(x)) {
                    System.out.println("Yes");
                }else {
                    System.out.println("No");
                }
            }
        }
    }
    public static void insert(int x){
        int k=(x%100003+100003)%100003;
        e[idx]=x;
        ne[idx]=h[k];
        h[k]=idx++;
    }
    public static boolean find(int x){
        int k=(x%100003+100003)%100003;
        for (int i = h[k]; i !=-1; i=ne[i]) {
            if(e[i]==x){
                return true;
            }
        }
        return false;
    }


}
